#include<bits/stdc++.h>
using namespace std;
int a[100005],sz[100005];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    sort(a+1,a+n+1);
    int tot=0,cnt=1;
    for(int i=2;i<=n+1;i++)
    {
        if(a[i]==a[i-1])
            cnt++;
        else{
            sz[++tot]=cnt;
            cnt=1;
        }
    }
    int ans=sz[tot],lft=sz[tot];
    for(int i=tot-1;i;i--)
    {
        ans+=max(0,sz[i]-lft);
        lft=max(0,lft-sz[i]);
        lft+=sz[i];
    }
    cout<<ans;
    return 0;
}
